package cn.iocoder.yudao.module.wms.controller.admin.saleorder.vo;

import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.wms.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.wms.dal.dataobject.person.PersonDO;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.VO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;

@Schema(description = "管理后台 - 销售订单主 Response VO")
@Data
@ExcelIgnoreUnannotated
public class SaleOrderRespVO implements VO {

    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22953")
    @ExcelProperty("id")
    private Integer id;

    @Schema(description = "流水号", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("流水号")
    private String serialNumber;

    @Schema(description = "业务员id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29432")
    @ExcelProperty("业务员id")
    @Trans(type = TransType.SIMPLE, target = PersonDO.class, fields = "name", ref = "personName")
    private Long personId;
    private String personName;

    @Schema(description = "客户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1053")
    @ExcelProperty("客户id")
    @Trans(type = TransType.SIMPLE, target = CustomerDO.class, fields = "name", ref = "customerName")
    private Long customerId;
    private String customerName;

    @Schema(description = "订单日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("订单日期")
    private LocalDateTime orderDate;

    @Schema(description = "备注", example = "随便")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "流程状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty(value = "流程状态", converter = DictConvert.class)
    @DictFormat("bpm_process_instance_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer status;
    /***
     * 数量
     */
    private Double number;

    /***
     * 已出库数量
     */
    private Double outNumber;
}